package wearingpartsDefinition

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type EquipmentPartRouter struct{}

// InitEquipmentPartRouter 初始化 设备件 路由信息
func (s *EquipmentPartRouter) InitEquipmentPartRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	EPRouter := Router.Group("EP").Use(middleware.OperationRecord())
	EPRouterWithoutRecord := Router.Group("EP")
	EPRouterWithoutAuth := PublicRouter.Group("EP")
	{
		EPRouter.POST("createEquipmentPart", EPApi.CreateEquipmentPart)             // 新建设备件
		EPRouter.DELETE("deleteEquipmentPart", EPApi.DeleteEquipmentPart)           // 删除设备件
		EPRouter.DELETE("deleteEquipmentPartByIds", EPApi.DeleteEquipmentPartByIds) // 批量删除设备件
		EPRouter.PUT("updateEquipmentPart", EPApi.UpdateEquipmentPart)              // 更新设备件
	}
	{
		EPRouterWithoutRecord.GET("findEquipmentPart", EPApi.FindEquipmentPart)       // 根据ID获取设备件
		EPRouterWithoutRecord.GET("getEquipmentPartList", EPApi.GetEquipmentPartList) // 获取设备件列表
	}
	{
		EPRouterWithoutAuth.GET("getEquipmentPartPublic", EPApi.GetEquipmentPartPublic) // 设备件开放接口
	}
}
